﻿<UserControl x:Class="WpfRcp.Views.Controls.CommonOptions"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:Helpers="clr-namespace:WpfRcp.Helpers"
    xmlns:Controls="clr-namespace:WpfRcp.Views.Controls"
    xmlns:Common="clr-namespace:WpfRcp.Core.Common;assembly=WpfRcp.Core">

    <UserControl.Resources>
        <Controls:WorkspaceScaleConverter x:Key="workspaceScaleConverter" />
        
        <DataTemplate DataType="{x:Type Common:Theme}">
            <Label Content="{Binding Name}" Margin="0" Padding="0" />
        </DataTemplate>
        
    </UserControl.Resources>
    
    <StackPanel>

        <Grid>
            <Label Content="{Binding Source={x:Static Helpers:ResHelper.Instance}, Path=Resource[Language], Mode=OneWay}" HorizontalAlignment="Left" />
            <ComboBox Width="160" DisplayMemberPath="EnglishName" SelectedValue="{Binding LanguageService.CurrentCulture}" ItemsSource="{Binding LanguageService.SupportedLanguages}" HorizontalAlignment="Right" />
        </Grid>

        <Grid Margin="0,5,0,0">
            <Label Content="{Binding Source={x:Static Helpers:ResHelper.Instance}, Path=Resource[Theme], Mode=OneWay}" HorizontalAlignment="Left" />
            <ComboBox Width="160" SelectedValue="{Binding ThemeService.CurrentTheme, Mode=TwoWay}" ItemsSource="{Binding ThemeService.SupportedThemes}" HorizontalAlignment="Right" />
        </Grid>

        <Grid Margin="0,5,0,0">
            <Label Content="{Binding Source={x:Static Helpers:ResHelper.Instance}, Path=Resource[WorkspaceScale], Mode=OneWay}" HorizontalAlignment="Left" />
            <Slider x:Name="m_ScaleSlider" SmallChange="0.1" LargeChange="0.5" Minimum="-1.0" Maximum="2.0" Width="160" HorizontalAlignment="Right" Style="{StaticResource PercentSlider}"
                                Value="{Binding Path=Settings.WorkspaceScale, Converter={StaticResource workspaceScaleConverter}, Mode=TwoWay}"/>
        </Grid>
    </StackPanel>

</UserControl>
